package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 奖品类别
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/8
 */
public enum PrizeTypeEnum {

    /**
     * 商品 - 1
     */
    PRODUCT(1, "商品"),

    /**
     * 优惠卷 - 2
     */
    COUPON(2, "优惠卷"),

    /**
     * 现金 - 3
     */
    MONEY(3, "现金"),

    /**
     * 积分 - 4
     */
    INTEGRAL(4, "积分"),

    /**
     * 谢谢参与 - 5
     */
    THANKS(5, "谢谢参与");


    private final Integer code;
    private final String message;

    PrizeTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getCodeMessage(Integer code) {
        PrizeTypeEnum status = Arrays.stream(PrizeTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return status == null ? "未知" : status.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}